<?php
/**
 * The default template for displaying content. Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage Sastro
 * @since Sastro 1.0
 */
 
 global $post, $more;
 $more = 0;
 $initial = THE_INITIAL;
?>

    <?php 
		$custom = get_post_custom($post->ID);
		$cf_imgurl = (isset($custom["image_url"][0]))? $custom["image_url"][0] : "";
		$imgurl = "";
		/* temporary not used */
		if($cf_imgurl!=""){
			$imgurl = $cf_imgurl;
		}elseif(has_post_thumbnail($post->ID) ){
			$thumbid = get_post_thumbnail_id($post->ID);
			$imginfo = wp_get_attachment_image_src( $thumbid, 'blog-post-image'); 
			$imgurl = $imginfo[0];
		}else{
			$imgurl ="";
		}
		
		if($imgurl!=''){
			$style = 'style="background-image:url('.$imgurl.'); background-repeat:no-repeat; background-size:cover;"';
		}else{
			$style = '';
		}
	?>
	<article id="post-<?php the_ID(); ?>" <?php post_class("content-loop"); ?>>
        <div class="stickybadge"></div>
        <div class="loopcontainer">
        	<div class="entry-icon"><div class="fa fa-quote-left"></div></div>
       		<div class="entry-content" <?php echo $style; ?>>
                <blockquote><?php the_content(); ?></blockquote>
                <h2 class="posttitle"><?php the_title(); ?></h2>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="entry-utility">
            <span class="meta-author"><?php _e('By', THE_LANG); ?> <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) );?>"><?php the_author();?></a></span>&nbsp;&nbsp;/&nbsp;&nbsp;
            <span class="meta-date"><i class="fa fa-calendar"></i>&nbsp; <?php the_time('M d, Y') ?></span>&nbsp;&nbsp;/&nbsp;&nbsp;
            <span class="meta-cat"><i class="fa fa-folder-open"></i>&nbsp; <?php the_category(', '); ?></span>&nbsp;&nbsp;/&nbsp;&nbsp;
            <span class="meta-comment"><i class="fa fa-comments"></i>&nbsp; <?php comments_popup_link(__('0 Comment', THE_LANG), __('1 Comment', THE_LANG), __('% Comments', THE_LANG)); ?></span>
            <div class="clearfix"></div>
        </div>
		<div class="clearfix"></div>
        <?php do_action('nvr_share_button'); ?>
	</article><!-- end post -->